package Controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Bean.Users_Bean;
import Model.ServiceFactory;
import myUtils.MyUtilss;

public class Modify_DeleteInfoServlet extends HttpServlet{
	private static final long serialVersionUID = 1L;
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//准备用户进行修改的
		String strOperationType=request.getParameter("opt");
		int iOpt=MyUtilss.objToint(strOperationType);
		//结果页面跳转
		String strPage="";
		
		if(iOpt==0){
			//修改操作
			//修改跳转操作
			
			//获取用户id主键值
			String strUid=request.getParameter("usid");
			Users_Bean useB=ServiceFactory.getUseInfoManagerServiceInstance().getUseInfoById(strUid);
			
			//将数据缓存到session对象中
			request.setAttribute("usee", useB);
			
			//跳转修改结果页
			strPage="Logined/user/ModifyInfor.jsp";
		}else if(iOpt==1){
			
		}
		
		//跳转到相应页面
		request.getRequestDispatcher(strPage).forward(request, response);
	}
}
